<!DOCTYPE html>
<html
  layout:decorator="components/layout"
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
  lang="zh-CN"
>
<head>
  <title>安全日志列表</title>
</head>
<body>
<div
  layout:fragment="content"
  id="app" v-cloak
>
  <div class="container">
    <div class="myHeader">
      <div class="myHeader-title">
        安全日志列表
      </div>
    </div>

    <el-row :gutter="10">
      <el-form label-width="80px">
        <el-col :span="6">
          <el-form-item label="用户名:">
            <el-input
              clearable
              size="mini"
              show-word-limit
              maxlength="50"
              v-model="form.loginName"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="2">
          <el-form-item label-width="0px">
            <el-button size="mini" type="primary" icon="el-icon-search" @click="searchPage"></el-button>
          </el-form-item>
        </el-col>

        <el-col :span="6">
          <el-form-item label="事件类型">
            <el-select v-model="form.eventType" @change="searchPage" placeholder="请选择" size="mini" clearable>
              <el-option v-for="[key,val] in fieldFormatter.tlogSecurity.eventTypeMap" :key="key" :label="val"
                         :value="key">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>

        <el-col :span="6">
          <el-form-item label="管理员">
            <el-select v-model="form.roleId" @change="searchPage" placeholder="请选择" size="mini" clearable>
              <el-option label="所有管理员"></el-option>
              <el-option v-for="[key,val] in sysRoleMap" :key="key" :label="val" :value="key">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-form>
    </el-row>

    <!--内容-->
    <my-table
      :data="page.records"
      :columns="columns"
      @handle-selection-change="selection"
    >
      <template #sys_user_role_list="row">
        <div v-for="sysUserRole in row.row.sysUserRoleList">
          {{fieldFormatter.generator(sysRoleMap)(sysUserRole.roleId)}}
        </div>
      </template>
      <template #operating="scope">
			<span>
        <el-button type="primary" size="mini" @click.stop.prevent="() => viewInfo(scope.row)">详情</el-button>
			</span>
      </template>
    </my-table>
    <div class="pagination">
      <el-pagination
        background
        @size-change="changeSize"
        @current-change="goto"
        :current-page="page.current"
        :page-sizes="[10, 20, 30]"
        :page-size="page.size"
        layout="total, sizes, prev, pager, next, jumper"
        :total="page.total"
      >
      </el-pagination>
    </div>
  </div>
</div>
<div layout:fragment="js">
  <script src="/static/js/module/tlog/model/TlogSecurity.js"></script>
  <script src="/static/js/module/tlog/api/tlogSecurityApi.js"></script>
  <script src="/static/js/module/system-config/api/sysRoleApi.js"></script>
  <script src="/static/js/module/tlog/admin_security_securityloglist.js"></script>
</div>
</body>
</html>
